﻿using InfoLogic.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace InfoLogic.Controllers
{
    public class HomeController : Controller
    {
        private UserContext db = new UserContext();

        public ActionResult Index()
        {
            ViewBag.Message = "Welcome To iNFOLOGIC";

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        //
        // GET: /Default1/Edit/5

        public ActionResult FindUserBusinesses(string UserId)
        {
            //var userid = (from e in db.Business
            //                   select e.UserId).FirstOrDefault();

            var business = (from b in db.Business
                            where b.UserId == UserId
                            select b).FirstOrDefault();

            return View(business);
        }
    }
}
